package polymorphicTask.perimeterAndArea;

public class Trapezoid extends Diagram{
    //梯形
    private int topLength;
    private int bottemLength;
    private int sideLength;
    private int height;

    public Trapezoid(){}

    public Trapezoid(int topLength, int bottemLength, int sideLength, int height) {
        this.topLength = topLength;
        this.bottemLength = bottemLength;
        this.sideLength = sideLength;
        this.height = height;
    }


    public int getTopLength() {
        return topLength;
    }

    public void setTopLength(int topLength) {
        this.topLength = topLength;
    }

    public int getBottemLength() {
        return bottemLength;
    }

    public void setBottemLength(int bottemLength) {
        this.bottemLength = bottemLength;
    }

    public int getSideLength() {
        return sideLength;
    }

    public void setSideLength(int sideLength) {
        this.sideLength = sideLength;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void perimeter(){
        System.out.println("梯形的周长为："+(topLength+bottemLength+sideLength*2));
    }
    public void area(){
        System.out.println("梯形的面积："+(topLength+bottemLength)*height*2);
    }
}
